package examples.helloworld

import de.saxsys.mvvmfx.FluentViewLoader
import javafx.application.Application
import javafx.application.Platform
import javafx.scene.Group
import javafx.scene.Scene
import javafx.stage.Stage

/**
 * Created by TK-chenbin on 2015/6/5.
 */
class Starter extends Application {
    public static void main(String[] args) {
        launch(Starter, args)
    }

    @Override
    void start(Stage primaryStage) throws Exception {
        Thread.start {
            def viewTuple = FluentViewLoader.fxmlView(HelloWorldView).load()
            Platform.runLater {
                def scene = new Scene(viewTuple.view, 800, 600)
                primaryStage.scene = scene
                primaryStage.centerOnScreen()
            }
        }
        primaryStage.scene = new Scene(new Group(), 400, 300)
        primaryStage.title = "Hello World Application"
        primaryStage.show()
    }
}
